package pojo;

import java.util.Date;

/**
 * 管理员登录实体类
 * 对应数据库表: user
 * 注意: 该类同时可用于普通用户和医生的登录，通过 user_role 字段区分角色
 */
public class AdminLogin {

    // 用户ID
    private Integer userId;

    // 用户名(病人为身份证号，医生为自定义账号)
    private String userName;

    // 联系电话
    private String telephone;

    // 登录密码
    private String password;

    // 真实姓名
    private String realName;

    // 用户角色(admin:管理员, doctor:医生, user:普通用户)
    private String userRole;

    // 最后登录时间
    private Date lastLogin;

    // 登录次数
    private Integer loginCount;

    // 创建时间
    private Date createTime;

    // 无参构造函数
    public AdminLogin() {
    }

    // 全参构造函数
    public AdminLogin(Integer userId, String userName, String telephone, String password,
                      String realName, String userRole, Date lastLogin, Integer loginCount,
                      Date createTime) {
        this.userId = userId;
        this.userName = userName;
        this.telephone = telephone;
        this.password = password;
        this.realName = realName;
        this.userRole = userRole;
        this.lastLogin = lastLogin;
        this.loginCount = loginCount;
        this.createTime = createTime;
    }

    // Getter 和 Setter 方法
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getUserRole() {
        return userRole;
    }

    public void setUserRole(String userRole) {
        this.userRole = userRole;
    }

    public Date getLastLogin() {
        return lastLogin;
    }

    public void setLastLogin(Date lastLogin) {
        this.lastLogin = lastLogin;
    }

    public Integer getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(Integer loginCount) {
        this.loginCount = loginCount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    // 重写 toString 方法，方便调试
    @Override
    public String toString() {
        return "AdminLogin{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", telephone='" + telephone + '\'' +
                ", realName='" + realName + '\'' +
                ", userRole='" + userRole + '\'' +
                ", lastLogin=" + lastLogin +
                ", loginCount=" + loginCount +
                ", createTime=" + createTime +
                '}';
    }
}